package cate.game.play.proce.move;

import cate.common.table.d.GDAttr;
import cate.common.table.d.GDSkill;
import cate.game.play.base.HpCfg;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class MoveParam {

	@NoteField("血量调整比例")
	private double hpChangeRate;

	@NoteField("血量结算配置")
	private List<HpCfg> hpCfgs = new ArrayList<>();

	public void setHpChangeRate(double hpChangeRate) {
		this.hpChangeRate = hpChangeRate;
	}

	public double getHpChangeRate(){
		return hpChangeRate;
	}

	public void addHpCfgByCoeff(double coeff) {
		hpCfgs.add(new HpCfg(GDSkill.Base.CASTER, GDAttr.ATT, coeff));
	}

	public List<HpCfg> getHpCfgs() {
		return hpCfgs;
	}


	@NoteField(value = "衍生的技能参数",detail = "附加的兄弟技能 自己能等")
	private Map<Integer,SkillParam> skillParam = new HashMap<>();

	public void addBrotherSkill(int skillTid, int brotherSkill) {
		SkillParam param = skillParam.get(skillTid);
		if (param == null) {
			param = new SkillParam();
			skillParam.put(skillTid, param);
		}
		param.addExBrotherSkill(brotherSkill);
	}

	public List<Integer> getExBrotherSkills(int skillTid) {
		SkillParam param = skillParam.get(skillTid);
		if (param != null) {
			return param.exBrotherSkills;
		}
		return null;
	}

	private static class SkillParam {

		public List<Integer> exBrotherSkills = new ArrayList<>();

		public void addExBrotherSkill(int brotherSkill) {
			this.exBrotherSkills.add(brotherSkill);
		}
	}
}
